﻿<catel:UserControl x:Class="Catel.Articles._03___MVVM.Examples.UserControlWithParameter.Company"
                   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                   xmlns:UserControlWithParameter="clr-namespace:Catel.Articles._03___MVVM.Examples.UserControlWithParameter"
                   xmlns:catel="http://catel.codeplex.com"
                   x:TypeArguments="UserControlWithParameter:CompanyViewModel">

    <!-- Resources -->

    <!-- Content -->
    <Grid>
        <!-- Row definitions -->
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <!-- Columns -->
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="10" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <!-- View model construction time -->
        <Label Grid.Row="0" Grid.ColumnSpan="2" Content="View model construction time:" />
        <Label Grid.Row="1" Grid.Column="1" ContentStringFormat="{}{0:HH:mm:ss.fff}" Content="{Binding ViewModelConstructionTime}" />

        <!-- Company details -->
        <StackPanel Grid.Row="2" Grid.ColumnSpan="2">
            <!-- Company name -->
            <Label Content="{Binding Name}" />

            <!-- CEO name -->
            <Label Content="{Binding CEOFullName}" />
        </StackPanel>

        <!-- First line managers -->
        <Label Grid.Row="3" Grid.ColumnSpan="2" Content="First line managers" />
        <ListBox Grid.Row="4" Grid.Column="1" ItemsSource="{Binding Managers}">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel>
                        <Label Content="{Binding FullName}" />
                        <Label Content="{Binding Gender}" />
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
    </Grid>
</catel:UserControl>
